﻿Imports Galdino
Imports BLL
Imports DTO
Public Class LoginM
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Protected Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
        Dim objLogin As New UsuarioDTO
        Dim objUsuario As New UsuarioDTO
        Dim bllUsuario As UsuarioBLL

        Try
            objLogin.pUsuario = txtUsuario.Text
            objLogin.pSenha = txtSenha.Text

            bllUsuario = New UsuarioBLL

            objUsuario = bllUsuario.Consultar(objLogin)

            If Not IsNothing(objUsuario) Then
                Session.Add("login", objUsuario)

                Response.Redirect("~/Interface/PgInicial.aspx")


            End If
        Catch ex As Exception

        End Try
    End Sub
End Class

'<asp:RequiredFieldValidator ID="rfvUsuario" runat="server" ErrorMessage="Preencha o Nome do Usuario!" CssClass="aviso" Display="Dynamic"></asp:RequiredFieldValidator>
'   <br />
' <asp:RequiredFieldValidator ID="rfvSenha" runat="server" ErrorMessage="Preencha uma Senha!" CssClass="aviso" Display="Dynamic"></asp:RequiredFieldValidator>

